package models.user;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import com.google.code.morphia.annotations.Entity;

import play.data.validation.Required;
import play.modules.morphia.Model;

@Entity
public class User extends Model {
	@Required private String name;
	@Required private String userId;
	@Required private String password;
	@Required private List<Role> roleSet;
	private Date createdDateTime;
	
	public User(String name, String userId, String password){
		this.name = name;
		this.userId = userId;
		this.password = password;
		this.roleSet = new ArrayList<Role>();
		roleSet.add(Role.Guest);
		this.createdDateTime = Calendar.getInstance().getTime();
	}
	
	public void setName(String name){
		this.name = name;
	}
	
	public void setPassword(String password){
		this.password = password;
	}
	
	public void setRoleSet(List<Role> roleSet){
		this.roleSet = roleSet;
	}
	
}
